package com.csun.cmny.provider.model.enums;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-05-27 10:31
 * @Description: the enum omc convert stat enum
 */
public enum OmcConvertStatEnum {

    /**
     * online omc convert stat enum.
     */
    /*
     * 已完成
     */
    FINISH(0, "线上"),

    /**
     * 待发货
     */
    NOT_SEND(1, "待发货"),

    /**
     * 已发货
     */
    IS_SEND(2, "已发货");

    /**
     * The Key.
     */
    Integer key;
    /**
     * The Value.
     */
    String value;

    OmcConvertStatEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * Gets key.
     *
     * @return the key
     */
    public Integer getKey() {
        return key;
    }

    /**
     * Gets value.
     *
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * 获取key获取value
     *
     * @param key key
     *
     * @return value value
     */
    public static String getValue(String key) {
        for (OmcConvertStatEnum ele : OmcConvertStatEnum.values()) {
            if (key.equals(ele.getKey())) {
                return ele.getValue();
            }
        }
        return null;
    }

    /**
     * 根据key获取该对象
     *
     * @param key key
     *
     * @return this enum
     */
    public static OmcConvertStatEnum getEnum(String key) {
        for (OmcConvertStatEnum ele : OmcConvertStatEnum.values()) {
            if (key.equals(ele.getKey())) {
                return ele;
            }
        }
        return null;
    }

    /**
     * 获取List集合
     *
     * @return List list
     */
    public static List<OmcConvertStatEnum> getList() {
        return Arrays.asList(OmcConvertStatEnum.values());
    }


}
